|
|
|
|
|
|
|
Unfortunately, authors of computer programs don't have that luxury. Due to the structured nature of computing, it's critically important to design your programs before beginning to code them. Many programmers tend to want to dive in and start coding right off the bat, but you should get into the habit of planning, even with small programs. If you do nothing else, sit down with a blank sheet of paper, make some notes about what you want the program to accomplish, and sketch out what the user interface should look like. |
|
|
|
|
|
|
|
|
|
Please keep in mind that the strategy presented in this chapter is by no means the only approach to programming, but rather one set of general guidelines. Your technique, of course, may be totally different.  |
|
|
|
|
|
|
|
|
|
|
How Design Fits into the Programming Process |
|
|
|
|
|
|
|
|
When creating a computer program, it's important to take a structured approach. Certain steps need to be accomplished in a certain order, and you might as well get used to doing things the right way. It's always tempting to fire up Visual Basic and dive right in to designing and coding the program, but a little time spent with proper planning can save you a lot of headaches later in the process. |
|
|
|
|
|
|
|
|
The key steps in creating a computer program are as follows: |
|
|
|
|
|
|
|
|
1. Plan the program's tasks (how it should work). |
|
|
|
|
|
|
|
|
2. Design the user interface (how it should look). |
|
|
|
|
|
|
|
|
3. Write the program's code (implement steps 1 and 2). |
|
|
|
|
|
|
|
|
4. Test and debug the program (including beta testing with users outside of the development team, if appropriate). |
|
|
|
|
|
|
|
|
5. Document and distribute the program (put it in use). |
|
|
|
|
|
|
|
|
These steps are very generalized and definitely not all-inclusive. As I discuss the sample program in this chapter, I'll list some steps specific to Visual Basic programming. |
|
|
|
|
|
|
|
|
The first two steps listed define the core process of actually building the program. The sample program in Chapter 2 provides a context for explaining some of the specifics in designing and building a Visual Basic program. Although you run the sample program in Chapter 2, the last two steps aren't covered until later in the book. |
|
|
|
|
|
|
|
|
|
If you are tackling a large project, breaking it down into smaller pieces will make it much more manageable. Many of Visual Basic's features can be used to divide up a large project among members of a development team.  |
|
|
|
|
|
|
|
|
|
|
Program Design in a Nutshell |
|
|
|
|
|
|
|
|
When starting a new project, it is tempting to just sit down and start hacking out code. After all, drawing the interface and writing the program code is the most fun and creative aspect of programming. However, a good program starts with a solid design. An in-depth flowchart |
|
|
|
|
|